package com.qdxwx.models.article;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;


/**
 * 文章资讯
 * @author developer
 */
public class Article implements Serializable{

    private static final long serialVersionUID = 8185062633638620333L;
    /**文章ID*/
	private int articleId;
	/**文章标题*/
	private String title;
	/**文章摘要*/
	private String intro;//
	/**文章封面*/
	private String cover;
	/**创建时间*/
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private LocalDateTime createTime;
	/**发布时间 */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private LocalDateTime updateTime;
	/**文章点击量*/
	private int viewCount;
	/**文章点赞量*/
	private int praiseCount;
	/** 排序值 */
	private int sort;
	/**文章评论数*/
	private int commentCount;
    /**文章对应的内容*/
	private String content;

    public Article() {
    }

    public int getArticleId() {
        return this.articleId;
    }

    public String getTitle() {
        return this.title;
    }

    public String getIntro() {
        return this.intro;
    }

    public String getCover() {
        return this.cover;
    }

    public LocalDateTime getCreateTime() {
        return this.createTime;
    }

    public LocalDateTime getUpdateTime() {
        return this.updateTime;
    }

    public int getViewCount() {
        return this.viewCount;
    }

    public int getPraiseCount() {
        return this.praiseCount;
    }

    public int getSort() {
        return this.sort;
    }

    public int getCommentCount() {
        return this.commentCount;
    }

    public void setArticleId(int articleId) {
        this.articleId = articleId;
    }

    public void setTitle(String title) {
        if (title==null) return;

        this.title = title;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public void setViewCount(int viewCount) {
        this.viewCount = viewCount;
    }

    public void setPraiseCount(int praiseCount) {
        this.praiseCount = praiseCount;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    public void setCommentCount(int commentCount) {
        this.commentCount = commentCount;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "Article{" +
                "articleId=" + articleId +
                ", title='" + title + '\'' +
                ", intro='" + intro + '\'' +
                ", cover='" + cover + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", viewCount=" + viewCount +
                ", praiseCount=" + praiseCount +
                ", sort=" + sort +
                ", commentCount=" + commentCount +
                '}';
    }
}
